
<%= render 'menu/caidau'%>
<div>
<table >
	<tr>
		<td style="vertical-align:text-top;">
			<fieldset align="left">
			<legend><h2>Search Engine</h2></legend>
			
			<%= form_tag :action => "search_process" do%>
				<table>
					<tr>
						<td>Id:</td>	
						<td><%= text_field_tag "id"%></td>	
					</tr>
					<tr>
						<td>Name:</td>	
						<td><%= text_field_tag "name"%></td>	
					</tr>
					<tr>
						<td>Author:</td>	
						<td><%= text_field_tag "author"%></td>	
					</tr>
					<tr>
						<td>Genre:</td>	
						<td><%= text_field_tag "genre"%></td>	
					</tr>
					<tr>
						<td>Publish Year:</td>	
						<td><%= text_field_tag "publish_year"%></td>	
					</tr>
					
				</table>
				  <br />
				<%= submit_tag "ok"%> <br /> <br />
			<% end %>
			<%= @notice %> <br /> <br />
			<%= link_to 'Previous', { :action=>'change_page' , :type=>-1} %> 
			Display from <%=(@from+1)%> to <%=(@to+1) %>
			 <%= link_to 'Next', { :action=>'change_page' , :type=>1} %>
			<br /> <br />
			</fieldset>
		</td>
		<td>
			<table class="dongsach">
				<tr>
	<% 
		
		for i in @from..@to
			
	%>
		
		<% r=@result[i] %>
						
			<td>
				
		<%= image_tag(('img/'+r.id.to_s+'.jpg').to_s, :width=> '200px', :height=> '300px', :id=>r.id)%> 
			
		
		
				<p><%= link_to r.Name, {:action => 'show_process', :id => r.id} %></p>
				
				<p><%= r.Author %></p>
				
				<%= r.Publish_year %>
			
			</td>
		
	
			<%	max=5;
			
			if (i%max==(max-1)) %>
			</tr><tr>
				
			<% end %>
	<% end %>
			</tr>

	<table>
			
			
			
		</td>
		
	</tr>
	
</table>

</div>


